package com.rx.servlet;

import java.io.IOException;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.rx.entity.Logs;
import com.rx.service.LogsServiceI;
import com.rx.service.LogsServiceImpl;


@WebServlet("/admin/LogsServlet")
public class LogsServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		LogsServiceI<Logs> lsi=new LogsServiceImpl();
		try {
			int curPage=1;
			if(null!=request.getParameter("curPage")) {
				curPage=Integer.valueOf(request.getParameter("curPage"));
			}
			
			Map<String,Object> map=lsi.getPageAll(curPage, 10);
			
			request.setAttribute("map", map);
			request.getRequestDispatcher("/admin/logs.jsp").forward(request, response);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

}
